package net.lab1024.sa.admin.module.app.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.lab1024.sa.admin.module.app.req.AppDollAlbumReq;
import net.lab1024.sa.admin.module.app.req.AppDollBindReq;
import net.lab1024.sa.admin.module.app.req.AppDollDetailReq;
import net.lab1024.sa.admin.module.app.req.AppOrderDetailReq;
import net.lab1024.sa.admin.module.app.rsp.AppDollDetailRsp;
import net.lab1024.sa.admin.module.app.service.AppDollService;
import net.lab1024.sa.admin.module.business.bjd.domain.vo.OrderVo;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 *
 * @author guolong.zhang
 * @date 2025/02/10 09:28
 **/
@RestController
@Tag(name = "app-娃娃")
@RequestMapping("app")
public class AppDollController {

    @Autowired
    private AppDollService appDollService;
    @Operation(summary = "娃娃绑定")
    @PostMapping("/doll/bind")
    public ResponseDTO<Void> bind(@RequestBody @Valid AppDollBindReq req) {
        appDollService.bind(req);
        return ResponseDTO.ok();
    }

    @Operation(summary = "娃娃解绑")
    @PostMapping("/doll/unbind")
    public ResponseDTO<Void> unbind(@RequestBody @Valid AppDollBindReq req) {
        appDollService.unbind(req);
        return ResponseDTO.ok();
    }

    @Operation(summary = "娃娃详情")
    @PostMapping("/doll/detail")
    public ResponseDTO<AppDollDetailRsp> detail(@RequestBody @Valid AppDollDetailReq req) {
        return ResponseDTO.ok(appDollService.detail(req));
    }

    @Operation(summary = "娃娃自定义名称")
    @PostMapping("/doll/nickName")
    public ResponseDTO<Void> nickName(@RequestBody @Valid AppDollDetailReq req) {
        appDollService.nickName(req);
        return ResponseDTO.ok();
    }

    @Operation(summary = "娃娃相册上传")
    @PostMapping("/doll/album")
    public ResponseDTO<Void> album(@RequestBody @Valid AppDollAlbumReq req) {
        appDollService.album(req);
        return ResponseDTO.ok();
    }
}
